﻿using Microsoft.Extensions.Hosting;

namespace Ebusiness_OrderService.Register
{
    public class ServiceRegisterHostService : IHostedService
    {
        public RegisterCenterServiceRegister consulServiceRegister { get; set; }

        public Task StartAsync(CancellationToken cancellationToken)
        {
            return Task.Run(() => consulServiceRegister.Register());
        }

        public Task StopAsync(CancellationToken cancellationToken)
        {
            return Task.Run(() => consulServiceRegister.DeleteRegister());
        }
    }
}
